import request from '@/utils/request';

// 用户登录
export function signIn(params) {
	return request({
		url: '/login',
		method: 'post',
		data: params,
	});
}

// 用户退出登录
export function signOut(params) {
	return request({
		url: '/user/signOut',
		method: 'post',
		data: params,
	});
}


// 登录方法
export function login(username, password, code, uuid) {
	return request({
		url: '/login',
		headers: {
			isToken: false
		},
		method: 'post',
		data: { username, password, code, uuid }
	})
}
// 退出方法
export function logout() {
	return request({
		url: '/logout',
		method: 'delete'
	})
}

// 获取用户详细信息
export function getInfo() {
	return request({
		url: '/system/user/getInfo',
		method: 'get'
	})
}

// 刷新方法
export function refreshToken() {
	return request({
		url: '/auth/refresh',
		method: 'post'
	})
}


// 获取验证码
export function getCodeImg() {
	return request({
		url: '/code',
		headers: {
			isToken: false,
		},
		method: 'get',
		timeout: 20000,
	});
}

// 获取验证码图片
export function getCaptchaImage() {

	return request({
		url: '/captchaImage',
		headers: {
			isToken: false,
		},
		method: 'get',
		timeout: 20000,
	});
}